#include <iostream>
#include "matrix.h"
#include "gauss.h"
using namespace std;

int main()
{
#ifdef LATEX
    freopen("out.md", "w", stderr);
#endif
    size_t rows, cols;
    std::cin >> rows >> cols;
    matrix_t mat{rows, cols};
    cin >> mat;
    cout << mat << endl; // magic
#ifdef LATEX
    cerr << "$$" << endl;
    cerr << mat.to_latex() << R"(\\\Rightarrow)" << endl;
#endif
    elimination::gauss_rows(mat);
// elimination::jordan_rows(mat);
// elimination::norm_rows(mat);
#ifdef LATEX
    cerr << mat.to_latex() << R"(\\)" << endl;
    cerr << "$$" << endl;
#endif
    // cout << mat << endl;
}